package com.czwj.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.czwj.dao.PermissionMapper;
import com.czwj.entities.Permission;
import com.czwj.service.PermissionService;


@Service
public class PermissionServiceImpl implements PermissionService {

	@Resource
	PermissionMapper mapper;
	
	@Override
	public List<Permission> search(Map<String, Object> Params) {
		// TODO Auto-generated method stub
		return this.mapper.search(Params);
	}

	@Override
	public int add(Permission rolePer) {
		// TODO Auto-generated method stub
		return this.mapper.insertSelective(rolePer);
	}

	@Override
	public int delete(Integer id) {
		// TODO Auto-generated method stub
		return this.mapper.deleteByPrimaryKey(id);
	}

	@Override
	public int deleteByRoleId(int roleId) {
		// TODO Auto-generated method stub
		return this.mapper.deleteByRoleId(roleId);
	}

	@Override
	public int deleteByRoleId2(int roleId) {
		// TODO Auto-generated method stub
		return this.mapper.deleteByRoleId2(roleId);
	}
}
